.TH std::error_code::operatorbool 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::error_code::operatorbool \- std::error_code::operatorbool

.SH Synopsis
   explicit operator bool() const noexcept;  \fI(since C++11)\fP

   Checks if the error code value is valid, i.e. non-zero.

.SH Parameters

   \fI(none)\fP

.SH Return value

   false if value() == 0, true otherwise.

.SH Notes

   Although this operator is often used as a convenient shorthand to check if any error
   was returned, as in if (ec) { /* handle error */ }, such use is not robust: some
   error codes, for example, HTTP status code 200, may indicate success as well.
